
#将已淘汰的玩家设置为观战游戏模式
gamemode spectator @a[tag=DieOutWatch,gamemode=!spectator] 

#将两个坐标始终保持在空中
execute as @e[type=armor_stand,tag=RunAwayCenter] at @s run tp @s ~ 150 ~
execute as @e[type=armor_stand,tag=DieOutCenter] at @s run tp @s ~ 150 ~
#将当前RunAwayCenter向DieOutCenter移动
execute as @e[type=armor_stand,tag=RunAwayCenter] at @s unless entity @e[type=armor_stand,tag=DieOutCenter,limit=1,distance=0..0.04] facing entity @e[type=armor_stand,tag=DieOutCenter,limit=1] feet rotated ~ 0 run tp @s ^ ^ ^0.04
#将世界边界中心点时刻设置在RunAwayCenter位置
execute at @e[type=armor_stand,tag=RunAwayCenter] unless entity @e[type=armor_stand,tag=DieOutCenter,limit=1,distance=0..0.04] run worldborder center ~ ~
#当两个坐标重合时，精准定位到格子
execute as @e[type=armor_stand,tag=RunAwayCenter] at @s if entity @e[type=armor_stand,tag=DieOutCenter,limit=1,distance=0..0.04] align xz run worldborder center ~ ~



##大逃杀所有阶段：
#   第一阶段：开启对局同意  1 min
#   第二阶段：选择英雄  1 min
#   第三阶段：初始化对局信息  1 ms
#   第四阶段：刷圈战斗阶段  12 min
#   第五阶段：获胜颁发奖励  1 ms

##执行对应阶段
#第一阶段：投票开局
execute if score IsTheDieOutGame SystemAdmin matches 1 run function nw:system/system_module/dieout_1ready
#第二阶段：选择英雄
execute if score IsTheDieOutGame SystemAdmin matches 2 run function nw:system/system_module/dieout_2selecthero
#第三阶段：初始化游戏
execute if score IsTheDieOutGame SystemAdmin matches 3 run function nw:system/system_module/dieout_3initgame
#第四阶段：当TimeClock为0时执行4
execute if score IsTheDieOutGame SystemAdmin matches 4 if score TimeClock DieOutInfo matches 0 run function nw:system/system_module/dieout_4executeing
#第四阶段：时刻将team人数记录在AlivePlayerCount中
execute if score IsTheDieOutGame SystemAdmin matches 4 store result score AlivePlayerCount DieOutInfo run team list DieOutTeam

#第五阶段：存活人数低于1时直接执行第五阶段
execute if score IsTheDieOutGame SystemAdmin matches 4.. if score AlivePlayerCount DieOutInfo matches ..1 run function nw:system/system_module/dieout_5wingame
# execute if score IsTheDieOutGame SystemAdmin matches 4.. if score AlivePlayerCount DieOutInfo matches ..0 run function nw:system/system_module/dieout_5wingame


